package manager.com.ithei.edu.info.manager.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class AgeUtil {
    //构造方法私有化
    private AgeUtil() {
    }
        //工具类转化生日到年龄,格式化
    public static String getAge(String birthday) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String agee = String.valueOf(new Date().getYear() - sdf.parse(birthday).getYear());
        return agee;
    }
}
